package com.zpark.status;

/**
 * 系统状态码枚举
 */
public enum StatusCode {
    // 成功状态
    SUCCESS(200, "操作成功"),

    // 用户相关错误 4000-4999
    USERNAME_EXISTS(4001, "用户名已存在"),
    PHONE_EXISTS(4002, "手机号已存在"),
    EMAIL_EXISTS(4003, "邮箱已存在"),
    USER_NOT_FOUND(4004, "用户不存在"),
    LOGIN_FAILED(4005, "用户名或密码错误"),
    PASSWORD_MISMATCH(4006, "原密码错误"),
    REGISTER_FAILED(4007, "注册失败"),
    UPDATE_FAILED(4008, "更新失败"),
    PASSWORD_UPDATE_FAILED(4009, "密码修改失败"),

    // 系统错误 5000-5999
    SYSTEM_ERROR(5000, "系统异常");

    private final int code;
    private final String message;

    StatusCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
